package com.ruoyi.smile.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smile.mapper.McGnMapper;
import com.ruoyi.smile.domain.McGn;
import com.ruoyi.smile.service.IMcGnService;

/**
 * 首页功能列Service业务层处理
 *
 * @author xin
 * @date 2025-03-08
 */
@Service
public class McGnServiceImpl implements IMcGnService
{
    @Autowired
    private McGnMapper mcGnMapper;

    /**
     * 查询首页功能列
     *
     * @param id 首页功能列主键
     * @return 首页功能列
     */
    @Override
    public McGn selectMcGnById(Long id)
    {
        return mcGnMapper.selectMcGnById(id);
    }

    /**
     * 查询首页功能列列表
     *
     * @param mcGn 首页功能列
     * @return 首页功能列
     */
    @Override
    public List<McGn> selectMcGnList(McGn mcGn)
    {
        return mcGnMapper.selectMcGnList(mcGn);
    }

    /**
     * 新增首页功能列
     *
     * @param mcGn 首页功能列
     * @return 结果
     */
    @Override
    public int insertMcGn(McGn mcGn)
    {
        mcGn.setCreateTime(DateUtils.getNowDate());
        return mcGnMapper.insertMcGn(mcGn);
    }

    /**
     * 修改首页功能列
     *
     * @param mcGn 首页功能列
     * @return 结果
     */
    @Override
    public int updateMcGn(McGn mcGn)
    {
        mcGn.setUpdateTime(DateUtils.getNowDate());
        return mcGnMapper.updateMcGn(mcGn);
    }

    /**
     * 批量删除首页功能列
     *
     * @param ids 需要删除的首页功能列主键
     * @return 结果
     */
    @Override
    public int deleteMcGnByIds(Long[] ids)
    {
        return mcGnMapper.deleteMcGnByIds(ids);
    }

    /**
     * 删除首页功能列信息
     *
     * @param id 首页功能列主键
     * @return 结果
     */
    @Override
    public int deleteMcGnById(Long id)
    {
        return mcGnMapper.deleteMcGnById(id);
    }
}
